home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / music / cthugha5.zip / CTHU5SRC.ZIP / INITSCRN.C < prev    next >
C/C++ Source or Header  |  1994-08-19  |  2KB  |  126 lines

  1. //
  2. // Cthugha - Audio Seeded Image Processing
  3. //
  4. // Zaph, Digital Aasvogel Group, Torps Productions 1993-1994
  5. //
  6.  
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <conio.h>
  11. #include <time.h>
  12. #include <dos.h>
  13. #include <signal.h>
  14. #include <memory.h>
  15.  
  16. #include "cthugha.h"
  17. #include "initscrn.h"
  18. #include "patch.h"
  19.  
  20. #include "banner.c"
  21. #include "cthu_hlp.c"
  22. #include "cdmix.c"
  23. #include "credits.c"
  24.  
  25. #define color_char(x,y,c,a) poke(0xb800,160*(y)+2*(x),((a)<<8)|(c));
  26.  
  27. void scroll_up(int x1, int y1, int x2,int y2,int lines,unsigned char color)
  28. {
  29.     union REGS r;
  30.  
  31.     r.h.ah=0x06;
  32.     r.h.al=lines;
  33.     r.h.bh=color;
  34.     r.h.cl=x1;
  35.     r.h.dl=x2;
  36.     r.h.ch=y1;
  37.     r.h.dh=y2;
  38.  
  39.     int86(0x10,&r,&r);
  40. }
  41.  
  42. void gotoxy(int x1, int y1)
  43. {
  44.     union REGS r;
  45.  
  46.     r.x.ax=0x0200;
  47.     r.h.bh=0x00;
  48.     r.h.dl=x1;
  49.     r.h.dh=y1;
  50.     int86(0x10,&r,&r);
  51. }
  52.  
  53. void quit_screen(void)
  54. {
  55.     int x,y,i;
  56.  
  57.     x=0; y=0;
  58.     for (i=0; i<IMAGEDATA_LENGTH; i+=2) {
  59.         color_char(x,y,IMAGEDATA[i],IMAGEDATA[i+1]);
  60.         x++;
  61.         if (x>79) {
  62.             x=0; y++;
  63.         }
  64.     }
  65.  
  66.     for( y=23; y < 25; y++ )
  67.         for( x=0; x < 80; x++ )
  68.             color_char(x,y,' ',7);
  69.  
  70.     gotoxy(0,23);
  71. }
  72.  
  73. void show_credits(void)
  74. {
  75.     int x,y,i;
  76.  
  77.     x=0; y=0;
  78.     for (i=0; i<CREDITS_LENGTH; i+=2) {
  79.         color_char(x,y,CREDITS[i],CREDITS[i+1]);
  80.         x++;
  81.         if (x>79) {
  82.             x=0; y++;
  83.         }
  84.     }
  85.  
  86.     for( y=23; y < 25; y++ )
  87.         for( x=0; x < 80; x++ )
  88.             color_char(x,y,' ',7);
  89.  
  90.     gotoxy(0,23);
  91. }
  92.  
  93.  
  94. void cdmix_screen(int ok)
  95. {
  96.     int x,y,i;
  97.  
  98.     x=0; y=0;
  99.     for (i=0; i<CDMIX_LENGTH; i+=2) {
  100.         color_char(x,y,CDMIX[i],CDMIX[i+1]);
  101.         x++;
  102.         if (x>79) {
  103.             x=0; y++;
  104.         }
  105.     }
  106.     gotoxy(0,23);
  107. }
  108.  
  109.  
  110. void help_screen(void)
  111. {
  112.     int x,y,i;
  113.  
  114.     x=0; y=0;
  115.     for (i=0; i<HELPDATA_LENGTH; i+=2) {
  116.         color_char(x,y,HELPDATA[i],HELPDATA[i+1]);
  117.         x++;
  118.         if (x>79) {
  119.             x=0; y++;
  120.         }
  121.     }
  122.     gotoxy(0,23);
  123.  
  124. }
  125.  
  126.